<div id="haibao_btn"  style="background:#62B3E7;width:38px;height:35px;line-height:8px;padding-top:3px;font-size:18px;top:80px;position:absolute;z-index:10;cursor:pointer;border-radius:100%;-moz-border-radius:100%;opacity:0.7;color:#fff;position:fixed;right:5px;text-align:center;" onclick="make_haibao()"><span class="fa fa-photo"></span><br><em style="font-size:8px;">海报</em></div>
<script type="text/javascript">
var btn_topValue = 0,// 上次滚动条到顶部的距离  
	btn_interval = null;// 定时器  
document.onscroll = function() {  
	if(btn_interval == null){
		$("#haibao_btn").fadeOut();	//慢慢隐藏
		btn_interval = setInterval("show_btn()", 1200); //启动定时器，每1秒执行1次  
	}  
	btn_topValue = document.documentElement.scrollTop;
}
function show_btn() {  
	// 判断此刻到顶部的距离是否和1秒前的距离相等  
	if(document.documentElement.scrollTop == btn_topValue) {  
		//alert("scroll bar is stopping!");  
		$("#haibao_btn").fadeIn();	//慢慢显示
		clearInterval(btn_interval);  
		btn_interval = null; 
	} 
}
function make_haibao(){
	layer.confirm("请选择海报类型",{
		title:false,
		btn:['普通海报','小程序海报'],
		btn1:function(i){
			layer.close(i);
			share_btn();
		},
		btn2:function(i){
			layer.close(i);
			var pic = "{:fun('wxapp@wxapp_codeimg',$info?urls('content/show',['id'=>$id]):get_url('location'),$userdb['uid'])}";
			if($("#haibao_codeimg").length>0){
				$("#haibao_codeimg").attr('src',pic);
			}else{
				$("#share_html img").each(function(){
					if($(this).attr("src").indexOf('index/qrcode/index.html')>0){
						$(this).attr('src',pic);
					}
				});
			}			
			share_btn();
		},
	});
}
</script>